import request from '@/utils/request'

//添加
export function addMenu(data) {
  return request({
    url: '/menu/insertMenu',
    method: 'post',
    data
  })
}

//获取列表
export function menuList(data) {
  return request({
    url: '/menu/selectMenuTree',
    method: 'get',
    params: data
  })
}

//获取单个数据
export function viewMenu(data) {
  return request({
    url: `/menu/selectMenu/${data}`,
    method: 'get'
  })
}

//更新
export function editMenu(data) {
  return request({
    url: `/menu/updateMenu`,
    method: 'put',
    data
  })
}

//删除
export function deleteMenu(data) {
  return request({
    url: `/menu/deleteMenu/${data}`,
    method: 'delete'
  })
}


//添加
export function addOperation(data) {
  return request({
    url: `/menu/insertMenuOperation`,
    method: 'post',
    data
  })
}


//获取列表
export function operationList(data) {
  return request({
    url: `/menu/selectMenuOperationList/${data}`,
    method: 'get'
  })
}


//获取单个数据
export function viewOperation(data) {
  return request({
    url: `/menu/selectMenuOperation/${data}`,
    method: 'get'
  })
}

//更新
export function editOperation(data) {
  return request({
    url: `/menu/updateMenuOperation`,
    method: 'put',
    data
  })
}

//删除
export function deleteOperation(data) {
  return request({
    url: `/menu/deleteMenuOperation/${data}`,
    method: 'delete'
  })
}

//清理菜单缓存相关
export function cleanMenuRelationCache(data) {
  return request({
    url: `/menu/cleanMenuRelationCache`,
    method: 'post'
  })
}




